Conversation
WalkthroughAdds a new directoryExists(string $path): bool API to the storage abstraction. Implements it in Local and S3 devices. S3 checks by listing objects with a normalized directory prefix. Updates unit tests for Local and S3, and adds an abstract getAdapterType() method to S3Base tests. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Device as Device (interface)
participant Local as Local
participant S3 as S3
Note over Device: New API: directoryExists(path)
Client->>Device: directoryExists(path)
alt Local adapter
Device->>Local: directoryExists(path)
Local-->>Device: boolean (filesystem dir check)
else S3 adapter
Device->>S3: directoryExists(path)
Note right of S3: Normalize path to have trailing "/"<br/>ListObjectsV2 prefix=path limit=1
S3-->>Device: boolean (any object with prefix)
Note over S3: On exception → return false
end
Device-->>Client: boolean
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
🧰 Additional context used🧬 Code graph analysis (5)src/Storage/Device/Local.php (2)
tests/Storage/Device/LocalTest.php (3)
src/Storage/Device.php (2)
src/Storage/Device/S3.php (2)
tests/Storage/S3Base.php (9)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Tests